﻿using FarmerJoe.ClassSettings;
using FarmerJoe.Helpers;
using Styx;
using Styx.CommonBot;
using Styx.TreeSharp;

namespace FarmerJoe.Classes
{
    public static partial class Hunter
    {
        public static Composite CombatBehavior_LowLevel
        {
            get
            {
                return new PrioritySelector(

                    SummonPet("Call Pet 1"),
                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),
                    new Decorator(ret => Me.Mounted, new Action(context => Mount.Dismount())),

                    new Decorator(ret => Me.GotAlivePet && Timers.SpellOkToCast("Pet Attack Pull", 2000) && ((Me.Pet.GotTarget && Me.Pet.CurrentTargetGuid != Me.CurrentTargetGuid) || !Me.Pet.GotTarget),
                        new Sequence(
                            new Action(delegate { Pets.CastPetAction("Attack"); }),
                            new Action(delegate { Timers.Reset("Pet Attack Pull"); }),
                            new Action(ctx => RunStatus.Failure)
                            )),


                    // Healing
                    Common.UseHealthManaRegenAgent(ClassParser.HealthPotion, 0),

                    Inventory.UseTrinket1(),
                    Inventory.UseTrinket2(),
                    
                    Movement.MoveToLOS(),
                    Movement.FaceTarget(),

                    Pets.DefendMe(),
                    Movement.Fixes(),

                    // Combat

                    Spells.Cast("Concussive Shot", ret => CT.IsApproachingMe() && CT.Distance > 15),
                    Spells.Cast("Steady Shot", ret => Me.CurrentFocus < 25),
                    Spells.Cast("Serpent String", ret => !CT.HasMyAura("Serpent String")),
                    Spells.Cast("Arcane Shot", ret=> Me.CurrentFocus > 20),
                    
                    
                    
                    
                    new Decorator(Movement.MoveToTarget(true, 35f))


                    );
            }
        }
    }
}
